using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class MirrorHandler : LightRayHandler {
	
	public override void initialize(int id, Vector3 position, float rotation, Color c, bool fixedObj){
		Type = ObjectType.Mirror;
		
		LevelConstants.nbMirror++;
		
		base.initialize(id, position, rotation, c, fixedObj);
	}
	
	
	public override List<LightHitInfo> getNextLightRay(LightHitInfo hitInfo){
		List<LightHitInfo> newRays = new List<LightHitInfo>();
		
		hitInfo.Direction = Vector3.Reflect(hitInfo.Direction,hitInfo.Normal);
		
		newRays.Add(hitInfo);
		return newRays;	
	}
	
	void OnDestroy(){
		LevelConstants.nbMirror--;	
	}
}
